package com.lude.erp.prototype.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.lude.erp.common.model.BaseModel;

@Entity(name = "system_function")
public class SystemFunction implements BaseModel
{

	private static final long serialVersionUID = 1L;

	private long functionId;

	private SystemFunctionSort systemFunctionSort;

	private String name;

	private Integer sequence;

	private String description;

	private Date createdDate;

	private Date createdDatetime;

	private Date updatedDate;

	private Date updatedDatetime;

	private Set<SystemFunctionPermission> systemFunctionPermissions = new HashSet<SystemFunctionPermission>(0);

	private Set<SystemFunctionMenu> systemFunctionMenus = new HashSet<SystemFunctionMenu>(0);

	@Id
	@GeneratedValue
	public long getFunctionId()
	{
		return functionId;
	}

	public void setFunctionId(long functionId)
	{
		this.functionId = functionId;
	}

	public SystemFunctionSort getSystemFunctionSort()
	{
		return systemFunctionSort;
	}

	public void setSystemFunctionSort(SystemFunctionSort systemFunctionSort)
	{
		this.systemFunctionSort = systemFunctionSort;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public Integer getSequence()
	{
		return sequence;
	}

	public void setSequence(Integer sequence)
	{
		this.sequence = sequence;
	}

	public String getDescription()
	{
		return description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public Date getCreatedDate()
	{
		return createdDate;
	}

	public void setCreatedDate(Date createdDate)
	{
		this.createdDate = createdDate;
	}

	public Date getCreatedDatetime()
	{
		return createdDatetime;
	}

	public void setCreatedDatetime(Date createdDatetime)
	{
		this.createdDatetime = createdDatetime;
	}

	public Date getUpdatedDate()
	{
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate)
	{
		this.updatedDate = updatedDate;
	}

	public Date getUpdatedDatetime()
	{
		return updatedDatetime;
	}

	public void setUpdatedDatetime(Date updatedDatetime)
	{
		this.updatedDatetime = updatedDatetime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "systemFunction")
	public Set<SystemFunctionPermission> getSystemFunctionPermissions()
	{
		return systemFunctionPermissions;
	}

	public void setSystemFunctionPermissions(Set<SystemFunctionPermission> systemFunctionPermissions)
	{
		this.systemFunctionPermissions = systemFunctionPermissions;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "systemFunction")
	public Set<SystemFunctionMenu> getSystemFunctionMenus()
	{
		return systemFunctionMenus;
	}

	public void setSystemFunctionMenus(Set<SystemFunctionMenu> systemFunctionMenus)
	{
		this.systemFunctionMenus = systemFunctionMenus;
	}

}
